package com.xzc.java8.B_Stream.j_numeric;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;

public class NumericRangeTest1 {

    public static void main(String[] args) {
        IntStream evenNumbers = IntStream.rangeClosed(1, 100).filter(n -> n % 2 == 0);
        System.out.println(evenNumbers.count());

        evenNumbers = IntStream.range(1, 100).filter(n -> n % 2 == 0);
        System.out.println(evenNumbers.count());

        evenNumbers = IntStream.rangeClosed(1, 100).filter(n -> n % 2 == 0);
        evenNumbers.forEach(System.out::println);
    }
}
